home *** CD-ROM | disk | FTP | other *** search
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-
- <html>
- <head>
- <title>Gestione foto di Mario Rossi</title>
- </head>
-
- <body>
-
- <h1>Gestione foto</h1>
-
-
- <%
-
- Const adOpenForwardOnly = 0
- Const adLockReadOnly = 1
-
- Dim contatore
- Dim sql1,sql2
- Dim conn, rs
- Dim pagNum
- Dim pagSize
- Dim i,j
-
- pagSize = 2
-
- Set conn = Server.CreateObject("ADODB.Connection")
- conn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.MapPath("/mdb-database/foto2.mdb")
-
- sql1 = "SELECT count(nome) AS contatore FROM Foto"
- sql2 = "SELECT * FROM Foto ORDER BY Data DESC"
-
- Set rs = Server.CreateObject("ADODB.RecordSet")
- rs.Open sql1, conn, adOpenForwardOnly, adLockReadOnly
-
- contatore = rs("contatore")
-
- rs.Close()
-
-
- 'Estrae il numero di pagina
- pagNum = cint(request.QueryString("pag"))
- If pagNum = 0 Then pagNum = 1
-
- 'Imposta la dimensione della pagina (il numero massimo di elementi da far comparire per ogni pagina)
- rs.PageSize = pagSize
-
- rs.Open sql2, conn, 3, adLockReadOnly
-
- %>
-
- Foto presenti nella base di dati: <%=contatore%><br><br>
- Inserisci una <a href="inseriscifoto.asp">nuova foto</a>
- <%
-
-
- rs.AbsolutePage = pagNum
-
- for i = 1 to pagSize
-
- if not rs.EOF Then
-
- if i mod 2 = 0 then
- strColor="#3333CC"
- else
- strColor="#FF0033"
- end if
-
- %>
-
- <li>
- <a style="color:<%=strColor%>" href="dettagliofoto.asp?nome=<%=rs("Nome")%>"><%=rs("Titolo")%>, scattata a <%=rs("Luogo")%></a>
- </li>
-
- <%
- rs.movenext
-
- Else
-
- Exit For
-
- End If
-
-
- next
-
- %>
-
- <br><hr><br>
-
- <div align="left">
-
- <%
- If pagNum > 1 Then
- %>
- <a href="<%=request.ServerVariables("PATH_INFO")%>?pag=<%=pagNum -1%><%=strTipo%>">«</a>
- <%
- End If
- %>
-
- <% for j = 1 to rs.PageCount %>
- <% if j = pagNum then %>
- <%=j%>
- <% else %>
- <a href="<%=request.ServerVariables("PATH_INFO")%>?pag=<%=j%><%=strTipo%>"><%=j%></a>
- <% end if %>
- <% next %>
-
- <%
- If pagNum < rs.PageCount Then
- %>
- <a href="<%=request.ServerVariables("PATH_INFO")%>?pag=<%=pagNum+1%><%=strTipo%>">»</a>
- <%
- End If
- %>
-
- </div>
-
- <%
- rs.close
- set rs = nothing
- conn.close
- set conn = nothing
-
- %>
-
- </ul>
-
- </body>
- </html>
-
-